package com.stgy.lease.web.api.controller;

import com.stgy.lease.common.result.Result;
import com.stgy.lease.web.api.service.ApartmentInfoService;
import com.stgy.lease.web.api.vo.ApartmentDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:ApartmentController
 * Package:com.stgy.lease.web.api.controller
 * Description:
 *
 * @Author:helei
 * @Create:2024/9/6 - 15:21
 */
@RestController
@RequestMapping("/app/apartment")
@Tag(name = "公寓信息")
public class ApartmentController {

    @Autowired
    private ApartmentInfoService apartmentInfoService;

    //http://localhost:8888/app/apartment/getDetailById?
    // id=1830404678916026369 GET
    @Operation(description = "根据id获取公寓信息")
    @GetMapping("/getDetailById")
    public Result<ApartmentDetailVo> getDetailById(@RequestParam Long id) {
        return Result.ok(apartmentInfoService.getDetailById(id));
    }

}
